﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
using FolderSelect;

namespace FizzDevelop
{
	static class Util
	{
		public static Language ExtToLanguage(string ext)
		{
			switch (ext.ToLower())
			{
				case ".vbs":
					return Language.VBScript;
				case ".cs":
					return Language.CSharp;
				case ".html":
				case ".htm":
				case ".php":
					return Language.HTML;
				case ".java":
					return Language.Java;
				case ".js":
					return Language.JavaScript;
				case ".py":
					return Language.Python;
				default:
					return Language.Plaintext;
			}
		}

		public static string GetFolder(string title)
		{
			FolderSelectDialog folderDialog = new FolderSelectDialog();
			folderDialog.Title = title;
			if (folderDialog.ShowDialog()) 
				return folderDialog.FileName;
			else
				return null;
		}
	}
}
